<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>网络U盘登录</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
<style type="text/css">
table{
	width: 260px;
	font-size: 18px;
}
input {
	width: 100%;
	font-size: 18px;
}
</style>
<script type="text/javascript" src="js/jquery-1.8.3.js"></script>
<script type="text/javascript">
	function logon(){
		var name=$("#name").val();
		var pwd=$("#pwd").val();
		$.post("user/logon",{name:name,pwd:pwd},function(data){
			if(data=="0"){
				alert("此用户不存在！");
			}else if(data=="1"){
				window.location.replace("./wangpan.jsp");
			}else if(data=="2"){
				alert("密码错误！");
			}
		});
	};
</script>
</head>
  
  <body>
  <h1>网络U盘</h1>
  <table>
  	<tr><td>用户名:</td></tr>
  	<tr><td><input type="text" id="name"></td></tr>
  	<tr><td>密&nbsp;码:</td></tr>
  	<tr><td><input type="password" id="pwd"></td></tr>
  	<tr><td><input type="button" onclick="logon()"  value="登录"></td></tr>
  </table>
<!-- 测试:<br>
测试账号1：用户名:admin&nbsp;&nbsp;&nbsp;密码:1234<br>
测试账号2：用户名:1234&nbsp;&nbsp;&nbsp;密码:1234   -->
   	
  </body>
</html>
